package org.jks.service;

import java.util.ArrayList;
import java.util.List;

import org.jks.model.TowerCoordinate;
import org.springframework.stereotype.Service;

@Service
public class TowerCoordinateService extends EntityService<TowerCoordinate>{
	
	public TowerCoordinateService(){
		MODEL_NAME = TowerCoordinate.class.getSimpleName();
		CLASS_NAME = TowerCoordinate.class;
	}
	
	public long countByFlightLineId(long id){
		List<Object> params = new ArrayList<Object>();
		params.add(id);
		return count("select count(*) from TowerCoordinate where FlightLine.Id=?", params);
	}
	
	public List<TowerCoordinate> findByFlightLineId(long id, int page, int pagesize){
		List<Object> params = new ArrayList<Object>();
		params.add(id);
		return find("from TowerCoordinate where FlightLine.Id=?", params, page, pagesize);
	}
}
